package com.lance.answer.gui.answer.gk.answer;

import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

@Slf4j
public class Test {

    public static void main(String[] args) throws Exception {


    //    InputStream userInputStream2 = new FileInputStream("libs//allUser.txt");
        InputStream userInputStream2 = new FileInputStream("d:\\0104"+"毛泽东思想和中国特色社会主义理论体系概论"+".user");
        List<String> userString2 = IOUtils.readLines(userInputStream2, "utf-8");
        Map<String, String> usernameAndPwd2 = Maps.newHashMap();
        for (String user : userString2) {
            String[] strs = user.split(",");
            String userCode = strs[0];
            String pwd = strs[1].substring(6, 14);
            pwd = "Ouchn" + pwd;
            usernameAndPwd2.put(userCode, pwd);
        }


        // 获取所有的用户名和密码
        InputStream userInputStream = new FileInputStream("libs//tmp.txt");
        List<String> userString = IOUtils.readLines(userInputStream, "utf-8");
        for (String user : userString) {
            String[] strs = user.split(",");
            String userCode = strs[0];
            if(usernameAndPwd2.containsKey(userCode)){
                System.err.println("????:"+userCode);
            }
        }








    }




}
